package gold.digger;

import gold.utils.InputUtil;

/**
 * Created by fanzhenyu02 on 2021/12/10.
 * common problem solver template.
 */
public class LC1247 {
    public long startExecuteTime = System.currentTimeMillis();


    class Solution {
        public int minimumSwap(String s1, String s2) {
            int xy = 0, yx = 0;
            char[] c1 = s1.toCharArray();
            char[] c2 = s2.toCharArray();
            for (int i = 0; i < c1.length; i++) {
                if (c1[i] == c2[i]) continue;
                if (c1[i] == 'x') xy++;
                else yx++;
            }

            if (((xy + yx) & 1) != 0) return -1;
            return xy / 2 + yx / 2 + (xy % 2 * 2);
        }
    }


    public void run() {
        int[] arr = InputUtil.toIntegerArray("[1,2,3]");
        System.out.println(new Solution().toString());
    }

    public static void main(String[] args) throws Exception {
        LC1247 an = new LC1247();
        an.run();

        System.out.println("\ncurrent solution total execute time: " + (System.currentTimeMillis() - an.startExecuteTime) + " ms.");
    }
}
